package com.db.serialize.domain;

import java.io.Serializable;
import java.util.Random;

public class SensorData implements Serializable {
    private double longitude;
    private double latitude;
    private double elevation;
    private double temperature;

    private static Random random = new Random();

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public double getElevation() {
        return elevation;
    }

    public void setElevation(double elevation) {
        this.elevation = elevation;
    }

    public double getTemperature() {
        return temperature;
    }

    public void setTemperature(double temperature) {
        this.temperature = temperature;
    }

    public static SensorData generate() {
        SensorData result = new SensorData();
        result.longitude = random.nextDouble();
        result.latitude = random.nextDouble();
        result.elevation = random.nextDouble();
        result.temperature = random.nextDouble();
        return result;
    }
}